package org.geometerplus.fbreader.book;

import java.util.LinkedList;
import java.util.List;

public class BookmarkSingelton { 
	
	private static BookmarkSingelton instance;
	
	private List<ExtendedBookmark> myBookmarkHolder = new LinkedList<ExtendedBookmark>();
	
	private class ExtendedBookmark{
		public long myBookmarkId;
		public long myBookId;
		public long myTxtId;
		public long myParentId;
		public long myCreationTime;
		public boolean myPrivateComment;
	}
	
	private BookmarkSingelton(){
//		privater Konstruktor verhindert eine Instanziierung, siehe Singelton Pattern
	}
	
	public static BookmarkSingelton getBookmarkSingeltonInstance(){
		if(instance == null){
			instance = new BookmarkSingelton();
		}
		return instance;
	}

	public List<ExtendedBookmark> getMyBookmarkHolder() {
		return myBookmarkHolder;
	}

	public void addBookmark(Bookmark bookmarkNew, Bookmark positionToInputFrom) {
	}

	public int getPadding(Bookmark bookmark) {
		int id = (int)bookmark.getId();
		int root_text_id = (int)bookmark.getMyRootTextId();
		int parent_id = (int)bookmark.getMyParentId();
		
		if( (id == root_text_id) && (id == parent_id)){
			return 0; //root_text
		}
		int padding = 0;
		while(parent_id != root_text_id){
			padding += 20;
			
		}
		return padding;
	}
	
}